package awt;

import java.awt.*;

/**
 * @author Mark
 * @version 1.0
 * @date 2020/5/17 9:15
 * @description 流布局
 */
public class FlowOut {
    public static void main(String[] args) {
        Frame frame = new Frame();

        Button button1 = new Button();
        Button button2 = new Button();
        Button button3 = new Button();
        Button button4 = new Button();
        Button button5 = new Button();

        // 东西南北布局/流式布局/表格布局
        frame.setLayout(new FlowLayout(FlowLayout.RIGHT));
        frame.setSize(200, 300);
        frame.add(button1);
        frame.add(button2);
        frame.add(button3);
        frame.add(button4);
        frame.add(button5);

        // java函数自动填充
        frame.pack();
        frame.setVisible(true);

    }
}
